-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: integrate publication contract with community & channel cont… #130
Conversation
src/publication/publication.cairo
Outdated
jolt_type: JoltType::Tip, | ||
recipient: profile_address, | ||
memo: "Tip User", | ||
amount: current_tip_amount + amount, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mentioned this earlier, but the amount should be just amount
. there's no need to add anything here.
> of IKarstPublications<ComponentState<TContractState>> { | ||
// ************************************************************************* | ||
// PUBLISHING FUNCTIONS | ||
// ************************************************************************* | ||
/// @notice performs post action | ||
/// @param contentURI uri of the content to be posted | ||
/// @param profile_address address of profile performing the post action | ||
fn post(ref self: ComponentState<TContractState>, post_params: PostParams) -> u256 { | ||
fn post(ref self: ComponentState<TContractState>, mut post_params: PostParams) -> u256 { | ||
// Initialize approval flag as false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after a few more research, it will be easier for us to make pub id unique from the get go, tying it to the profile address is not the most scalable approach. Let's just have a publication counter and increase it anytime a post, comment, repost is made
src/publication/publication.cairo
Outdated
ref self: ComponentState<TContractState>, | ||
profile_address: ContractAddress, | ||
pub_id: u256, | ||
channel_id: u256, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to pass in the channel and community id, as these are already stored in the publication struct. retrieve the publication using the pub id and get the channel id and community id from there
profile_address: ContractAddress, | ||
pub_id: u256, | ||
channel_id: u256, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get these ids from the publication struct
…ract